<?php

  //////////////////////////////////////////////////////////////////
  // OrbitFAQ                                                     //
  // ---------                                                    //
  //                                                              //
  // Orbit FAQ was solely written and developed by Orbit Services //
  // http://www.orbitservices.net                                 //
  //                                                              //
  // Access the Forum here:                                       //
  // http://forums.orbitservices.net/index.php?c=4                //
  //                                                              //
  // OrbitFAQ utilises the following opensource projects/classes; //
  //  + Fckeditor - http://www.fckeditor.net                      //
  //  + Smarty Template Engine - http://smarty.php.net            //
  //  + Swift Email Class - http://www.swiftmailer.org/           //
  //  + OWASP PHP Filter Project - http://www.owasp.org           //
  //  + MySQL Search Class by Stephen Bartholomew                 //
  //                                                              //
  //////////////////////////////////////////////////////////////////

  $smarty->assign("OrbitFAQTitle","Administration Panel Home");

  // Function to reduce our version information
  // to a flat number for comparison
  function ReduceVersion($version)
    {
      // force lower case just in case we mistyped the beta with a capital
      $version = strtolower($version);
      // strip out the beta version details
      $version = str_replace ( " beta ", "", $version );
      // strip out the fullstops
      $version = str_replace ( ".", "", $version );

      return $version;
    }

  // Get the Version Control Current Version

    // define the version control server
    $ovc = "http://versioncontrol.orbitservices.net/index.php?package=orbitfaq";

    if (fopen($ovc, "r"))
      {
        // open the version control server
        $handle = fopen($ovc, "r");
        // read the latest versin of the package
        $ovc_version = fread($handle, '1500');
        // close the handle
        fclose($handle);
      }


    $ovc_version = ReduceVersion($ovc_version);
    $orbitfaq_version = ReduceVersion($orbitfaq_version);

    if($ovc_version > $orbitfaq_version)
      {
        $version_warning = "A newer version of OrbitFAQ is available<br />please update from <a href='http://sourceforge.net/projects/orbitfaq/' target='_blank'>http://sourceforge.net/projects/orbitfaq/</a>";
      }

  $smarty->assign("OrbitVersionWarning","$version_warning");

  $smarty_template_file = "$AdminFullPath/skins/$AdminSkin/mod_frontpage.tpl";

?>